<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>點膠機防呆</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">	
    <link rel="stylesheet" href="./4/lumen/bootstrap.css" media="screen">
    <link rel="stylesheet" href="./_assets/css/custom.min.css">
  </head>
  <body>
  <div class="container">
	<form>
	  <fieldset>
		<legend>點膠機防呆</legend>
		<!--button type="button" id="btnNext" class="btn btn-primary">下一箱</button-->
		<div class="form-group row">
		  <label class="col-sm-2 col-form-label" for="inputDefault">目前訂單號:</label>
		  <div class="col-sm-10">
		  <input class="form-control" placeholder="P8102G" id="co" type="text">
		  </div>
		</div>		
		<div class="form-group row">
		  <label for="staticEmail" class="col-sm-2 col-form-label">訂單編號:</label>
		  <div class="col-sm-10">
			<input readonly="" class="form-control-plaintext" id="coo" value="" type="text">
		  </div>
		</div>
		<div class="form-group row">
		  <label for="staticEmail" class="col-sm-2 col-form-label">產品型號:</label>
		  <div class="col-sm-10">
			<input readonly="" class="form-control-plaintext" id="item" value="" type="text">
		  </div>
		</div>
		
		<div class="form-group row">
		  <label class="col-sm-2 col-form-label" for="inputDefault">調配完訂單號:</label>
		  <div class="col-sm-8">
		  <input class="form-control" placeholder="P8102G" id="co2" type="text">
		  </div>
		  <div class="col-sm-2">
		   <input readonly="" class="form-control-plaintext" id="msg" value="" type="text">
		  </div>
		  
		</div>		
	</form>	
	<p class="lead">
    <a class="btn btn-primary btn-lg" href="index.html" role="button">返回</a>
	</p>
	</div>
    <script src="./_vendor/jquery/dist/jquery.min.js"></script>
    <script src="./_vendor/popper.js/dist/umd/popper.min.js"></script>
    <script src="./_vendor/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="./_assets/js/custom.js"></script>
	<script>
	var disks;
	var cks=new Array(4);
		$("#co").keypress(function(e){ //change
		  console.log($("#co").val());
		  $("#co2").val("");
		  var key = e.which;
		  if (key == 13) { 
			$.ajax({ url: "getco.php?lot="+$("#co").val(), 
					dataType : "text",
					success: function(data){
					console.log(data);
					$("#coo").val($("#co").val());
					$("#item").val(data);
				  }
				  });		  
		  
			$( "#co2" ).focus();
		 }
		});	
		
		$("#co2").keypress(function(e){
		  console.log($("#co2").val());

		  dk=$("#co2").val();
		  var key = e.which;
		  if (key == 13) { 
				if ($("#co2").val()==$("#co").val() ){
					$(msg).val("相同訂單");
					$("#co").select();
				}else{
					$(msg).val("不同訂單");
					$("#co2").select();
				}
			
			}
		  });	
	
		
	</script>
	
	
  </body>
</html>
